// $Id: swap_1_w.cpp 2 2009-09-02 08:47:42Z joseph2002 $
/*
 * Copyright 2009 Joseph Wu
 * Distributed under the Boost Software License, Version 1.0.
 * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
 *
 * For more information, see http://xpcomplus.sourceforge.net
 */

#include <boost/test/unit_test.hpp>
#include <xpcom/string.hpp>

#ifdef XPCOM_HAS_2BYTE_WCHAR_T

BOOST_AUTO_TEST_CASE(test_swap_1_w)
{
    xpcom::wstring s1 = L"Asss ui";
    xpcom::wstring s2 = s1;
    xpcom::wstring s3 = L"wwww";
    xpcom::wstring s4 = s3;

    BOOST_CHECK(s1 == s2);
    BOOST_CHECK(s3 == s4);
    swap(s1, s3);
    BOOST_CHECK(s1 == s4);
    BOOST_CHECK(s3 == s2);

    s4.swap(s2);
    BOOST_CHECK(s1 == s2);
    BOOST_CHECK(s3 == s4);
}

#endif
